package com.lianup.noname.common;


import java.util.stream.Stream;

public enum HttpStatusEnum {

    OK(200,"OK") ,NOT_FOUND(404,"NOT_FOUND");

    private int status;
    private String desc;

    HttpStatusEnum(int status,String desc){
        this.status = status;
        this.desc = desc;
    }

    public String getDesc(){
        return desc;
    }


    public int getStatus(){
        return status;
    }

    public static HttpStatusEnum valueOf(Integer value){
        return Stream.of(values()).filter(status->status.getStatus() == value).findAny().orElse(null);
    }
}
